import DBUtils
import Login


class TestLogin:

    def test_login1(self):
        # name, password,info,test_png
        Login.login2('lisi','123456','个人理财系统','test_login1')



    def test_login2(self):
        # name, password,info,test_png
        Login.login2('admin','123456','后台管理系统','test_login2')


    def test_login3(self):

        sql = "insert into user(username,password) values(%s,md5(%s))"
        param1 = ["lisi3","123!@#$%^%&456"]

        DBUtils.update(sql, param1)
        #

        Login.login2('lisi3','123!@#$%^%&456','个人理财系统','test_login3')

        sql = "delete from user where username = %s"
        param1 = ["lisi3"]

        DBUtils.update(sql, param1)


    def test_login4(self):
        # name,password,info,test_png,args
        Login.login3('lisi3','123456','用户名不存在','test_login4',1)


    def test_login5(self):
        Login.login3('lisi', '1234567', '密码错误', 'test_login5', 2)


    def test_login6(self):
        Login.login3('admin1','123456','用户名不存在','test_login6',1)


    def test_login7(self):
        Login.login3('admin', '1234567', '密码错误', 'test_login7', 2)
